<?php


class Food extends CI_Controller {

	function index()
	{
		echo 'Hello World!';
		$this->load->model('label');
		$data['labelArray'] = $this->label->get_last_ten_entries();
		$data['title'] = "Restaurant Home Page";
		$this->load->view('restaurant/restaurantHome', $data);
		//print_r($data['labelArray']);
	}
	
	function addNewFood()
	{
		echo 'Start add a new Food <br/>';
		$date['name'] = "经典炒饭"; 
        $date['unitPrice']= "20";
        $date['isSpicy']= "no";
		$date['isNew'] = "yes"; 
        $date['picture']= "/foodDefault";
        $date['categoryId']= 1;
		$date['popularity'] = "5"; 
        $this->load->model('foodModel');
        $this->foodModel->insert_entry($date);
		echo 'End add a new Food <br/>';
	}
}